package com.cmc.cloud.cmclink.doc.vo.manifestvo.manifestcntr;

import cn.hutool.core.collection.CollectionUtil;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import org.apache.commons.lang3.StringUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author 陈正
 * @date 2025/8/25
 */
@Schema(description = "管理后台 - hscode 导出excel VO")
@Data
@Builder
@ToString(callSuper = true)
@AllArgsConstructor
@NoArgsConstructor
public class ManifestCntrExportCnVo {
    @ExcelProperty(value = "船名", order = 1)
    private String bookingVesselCn;
    @ExcelProperty(value = "航次", order = 2)
    private String bookingVoyageCn;
    @ExcelProperty(value = "提单号", order = 3)
    private String manifestNoCn;
    @ExcelProperty(value = "箱号", order = 4)
    private String cntrNoCn;
    @ExcelProperty(value = "箱型", order = 5)
    private String cntrSizeTypeCn;
    @ExcelProperty(value = "封号", order = 6)
    private String sealNoCn;
    @ExcelProperty(value = "件数", order = 7)
    private String quantityCn;
    @ExcelProperty(value = "重量", order = 8)
    private String grossWeightCn;
    @ExcelProperty(value = "尺码", order = 9)
    private String measurementCn;
    @ExcelProperty(value = "整拼", order = 10)
    private String lclCn;
    @ExcelProperty(value = "导入错误信息", order = 11)
    private String errorMsg;
    @ExcelIgnore
    private List<String> errorMsgList = new ArrayList<>();

    public String getErrorMsg() {
        if (CollectionUtil.isNotEmpty(errorMsgList)) {
            return StringUtils.join(errorMsgList, ",");
        }
        return null;
    }
}
